package com.zretc.baiDuFace;

import java.util.HashMap;
import java.util.Map;
import com.zretc.util.GsonUtils;
import com.zretc.util.HttpUtil;

public class FaceDetelPerson {
	
	
	
	public static String deletePeron() {
		 // 请求url
	    String url = "https://aip.baidubce.com/rest/2.0/face/v3/faceset/face/delete";
	    
	 
	    
	    try {
	        Map<String, Object> map = new HashMap<>();
	        map.put("group_id", "faceLogin");
	        map.put("user_id", "0001");
	        map.put("face_token", "d131f3d7ddc6da54493e5ac6e0a2fb48");
	       
	
	        String param = GsonUtils.toJson(map);
	
	        // 注意这里仅为了简化编码每一次请求都去获取access_token，线上环境access_token有过期时间， 客户端可自行缓存，过期后重新获取。
	        String accessToken = "24.810201ae6dcaa18b5376db6258eb9e42.2592000.1597653190.282335-21458214";
	
	        String result = HttpUtil.post(url, accessToken, "application/json", param);
	        System.out.println(result);
	        return result;
	    } catch (Exception e) {
	        e.printStackTrace();
	    }
	    return null;
	}

public static void main(String[] args) {
	
	FaceDetelPerson.deletePeron();
}
}
